#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>

int main()
{
    int s = 0;
    int n = 0;
    int sum = 0;

    for (int i = 10000; i < 100000; i++)
    {
        sum = 0;
        int num = i;
        int count = 0;
        n = 0;
        while (num >= 10)
        {
            s = num % 10;
            for (int j = 0; j < count; j++)
                s *= 10;
            n += s;
            sum += num / 10 * n;
            num /= 10;
            count++;
        }
        if (sum == i)
            printf("%d ", i);
    }
    return 0;
}